package com.ls.pattern.establish.factory.abstractfactory;

import com.ls.pattern.establish.factory.pizza.BJCheesePizza;
import com.ls.pattern.establish.factory.pizza.BJPepperPizza;
import com.ls.pattern.establish.factory.pizza.Pizza;

public class BJFactory implements AbsFactory {

    @Override
    public Pizza createPizza(String orderType) {
        Pizza pizza = null;
        if (orderType.equals("cheese")) {
            pizza = new BJCheesePizza();
            System.out.println(pizza.order());
        } else if (orderType.equals("pepper")) {
            pizza= new BJPepperPizza();
            System.out.println(pizza.order());
        }
        return pizza;
    }
}
